Template - Auto Git Pull or Push
(19 actions, 16 KB)
0 Get Dictionary from
[Shortcut Input]
➔ inputDict
»
1
5
1 Get Dictionary Value for
operation
in
[0 inputDict]
➔ operation
»
9
14
2 DataJar > GetValueIntent »
7
keyPath
:
Auto Backup Vault Repos
3 Run Shortcut
isOnline?
»
Workflow
:
{ "workflowIdentifier": "9C48945F-7E22-4EFA-9334-61777791A46C", "workflowName": "isOnline?", "isSelf": false }
4 If
[3 Shortcut Result
as Boolean
]
is true
5 Split Text
[0 inputDict
.repo(s)
]
by New Lines »
6 Repeat with Each in
[5 Split Text]
7 Get Dictionary Value for
[Repeat Item]
.absolutePath_
[DeviceDetails
’s OS
]
in
[2 Value]
➔ absolutePath
»
9
12
14
8 If
[DeviceDetails
’s OS
]
is
macOS
9 Run Shell Script
InputMode
:
to stdin
Shell
:
/bin/zsh
Script
:
cd "
[7 absolutePath]
" git auto-
[1 operation]
RunAsRoot
:
false
10 End If
11 If
[DeviceDetails
’s OS
]
is
iOS
12 a-Shell > ExecuteCommandIntent »
command
:
[cd "
[7 absolutePath]
", lg2 status -s]
openWindow
:
close
ShowWhenRun
:
false
13 If
[12 output]
has any value
14 a-Shell > ExecuteCommandIntent
command
:
[cd "
[7 absolutePath]
", lg2 add ., lg2 commit -m "Updating <
[Repeat Item]
> from my
[DeviceDetails
’s Device Model
]
(
[CurrentDate
{"Date Style":"Custom","WFDateFormat":"yyyy-MM-dd HH:mm:ss","WFISO8601IncludeTime":false}
]
)", lg2
[1 operation]
]
keepGoing
:
true
openWindow
:
close
ShowWhenRun
:
false
15 End If
16 End If
17 End Repeat with Each ▵
6
18 End If ▵
4